package com.example.tests;


import org.testng.annotations.Test;
import com.example.utils.SortedListOf;
import static org.junit.Assert.assertThat;
import static org.hamcrest.Matchers.*;

public class ContactCreationTests extends BaseClass {


	@Test(dataProvider = "randomValidContactsGenerator")
	public void ContactCreationWithValidData(ContactData grcontact) throws Exception {
		SortedListOf<ContactData> oldList = app.getContactHelper().getContacts();
		app.getContactHelper().createContact(grcontact);
		SortedListOf<ContactData> newList = app.getContactHelper().getContacts();
		assertThat(newList, equalTo(oldList.withAdded(grcontact)));

	}
}
